home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / QuickdrawText.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  11.2 KB  |  405 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QuickdrawText.a
  3. ;
  4. ;    Contains:    Quickdraw Text Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1983-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QUICKDRAWTEXT__') = 'UNDEFINED' THEN
  19. __QUICKDRAWTEXT__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.  
  28. ;  new CGrafPort bottleneck ("newProc2") function, used in Unicode Text drawing 
  29. ;
  30. ; extern OSStatus StandardGlyphs(void *dataStream, ByteCount size)
  31. ;
  32.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  33.         IMPORT_CFM_FUNCTION StandardGlyphs
  34.     ENDIF
  35.  
  36.  
  37.  
  38.                                                             ; CharToPixel directions 
  39. leftCaret                        EQU        0                    ;Place caret for left block
  40. rightCaret                        EQU        -1                    ;Place caret for right block
  41. kHilite                            EQU        1                    ;Direction is SysDirection
  42. smLeftCaret                        EQU        0                    ;Place caret for left block - obsolete 
  43. smRightCaret                    EQU        -1                    ;Place caret for right block - obsolete 
  44. smHilite                        EQU        1                    ;Direction is TESysJust - obsolete 
  45.  
  46.                                                             ;Constants for styleRunPosition argument in PortionLine, DrawJustified, MeasureJustified, CharToPixel, and PixelToChar.
  47. onlyStyleRun                    EQU        0                    ; This is the only style run on the line 
  48. leftStyleRun                    EQU        1                    ; This is leftmost of multiple style runs on the line 
  49. rightStyleRun                    EQU        2                    ; This is rightmost of multiple style runs on the line 
  50. middleStyleRun                    EQU        3                    ; There are multiple style runs on the line and this is neither the leftmost nor the rightmost. 
  51. smOnlyStyleRun                    EQU        0                    ; obsolete 
  52. smLeftStyleRun                    EQU        1                    ; obsolete 
  53. smRightStyleRun                    EQU        2                    ; obsolete 
  54. smMiddleStyleRun                EQU        3                    ; obsolete 
  55. ;  type for styleRunPosition parameter in PixelToChar etc. 
  56. ; typedef short                         JustStyleCode
  57.  
  58. FontInfo                RECORD 0
  59. ascent                     ds.w    1                ; offset: $0 (0)
  60. descent                     ds.w    1                ; offset: $2 (2)
  61. widMax                     ds.w    1                ; offset: $4 (4)
  62. leading                     ds.w    1                ; offset: $6 (6)
  63. sizeof                     EQU *                    ; size:   $8 (8)
  64.                         ENDR
  65. FormatOrder                RECORD 0
  66. elements                 ds.w    1
  67. sizeof                     EQU *                    ; size:   $2 (2)
  68.                         ENDR
  69.  
  70.  
  71. ; typedef FormatOrder *                    FormatOrderPtr
  72.  
  73. ;  FormatStatus was moved to TextUtils.i 
  74. OffPair                    RECORD 0
  75. offFirst                 ds.w    1                ; offset: $0 (0)
  76. offSecond                 ds.w    1                ; offset: $2 (2)
  77. sizeof                     EQU *                    ; size:   $4 (4)
  78.                         ENDR
  79. OffsetTable                RECORD 0
  80. elements                 ds.b    3 * OffPair.sizeof
  81. sizeof                     EQU *                    ; size:   $C (12)
  82.                         ENDR
  83.  
  84.  
  85. ;
  86. ; pascal short Pixel2Char(Ptr textBuf, short textLen, short slop, short pixelWidth, Boolean *leadingEdge)
  87. ;
  88.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  89.         Macro
  90.         _Pixel2Char
  91.             move.l              #$820E0014,-(sp)
  92.             dc.w                $A8B5
  93.         EndM
  94.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  95.         IMPORT_CFM_FUNCTION Pixel2Char
  96.     ENDIF
  97.  
  98. ;
  99. ; pascal short Char2Pixel(Ptr textBuf, short textLen, short slop, short offset, short direction)
  100. ;
  101.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  102.         Macro
  103.         _Char2Pixel
  104.             move.l              #$820C0016,-(sp)
  105.             dc.w                $A8B5
  106.         EndM
  107.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  108.         IMPORT_CFM_FUNCTION Char2Pixel
  109.     ENDIF
  110.  
  111. ;
  112. ; pascal short PixelToChar(Ptr textBuf, long textLength, Fixed slop, Fixed pixelWidth, Boolean *leadingEdge, Fixed *widthRemaining, JustStyleCode styleRunPosition, Point numer, Point denom)
  113. ;
  114.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  115.         Macro
  116.         _PixelToChar
  117.             move.l              #$8222002E,-(sp)
  118.             dc.w                $A8B5
  119.         EndM
  120.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  121.         IMPORT_CFM_FUNCTION PixelToChar
  122.     ENDIF
  123.  
  124. ;
  125. ; pascal short CharToPixel(Ptr textBuf, long textLength, Fixed slop, long offset, short direction, JustStyleCode styleRunPosition, Point numer, Point denom)
  126. ;
  127.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  128.         Macro
  129.         _CharToPixel
  130.             move.l              #$821C0030,-(sp)
  131.             dc.w                $A8B5
  132.         EndM
  133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  134.         IMPORT_CFM_FUNCTION CharToPixel
  135.     ENDIF
  136.  
  137. ;
  138. ; pascal void DrawJustified(Ptr textPtr, long textLength, Fixed slop, JustStyleCode styleRunPosition, Point numer, Point denom)
  139. ;
  140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  141.         Macro
  142.         _DrawJustified
  143.             move.l              #$80160032,-(sp)
  144.             dc.w                $A8B5
  145.         EndM
  146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  147.         IMPORT_CFM_FUNCTION DrawJustified
  148.     ENDIF
  149.  
  150. ;
  151. ; pascal void MeasureJustified(Ptr textPtr, long textLength, Fixed slop, Ptr charLocs, JustStyleCode styleRunPosition, Point numer, Point denom)
  152. ;
  153.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  154.         Macro
  155.         _MeasureJustified
  156.             move.l              #$801A0034,-(sp)
  157.             dc.w                $A8B5
  158.         EndM
  159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION MeasureJustified
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal Fixed PortionLine(Ptr textPtr, long textLen, JustStyleCode styleRunPosition, Point numer, Point denom)
  165. ;
  166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  167.         Macro
  168.         _PortionLine
  169.             move.l              #$84120036,-(sp)
  170.             dc.w                $A8B5
  171.         EndM
  172.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION PortionLine
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal void HiliteText(Ptr textPtr, short textLength, short firstOffset, short secondOffset, OffsetTable offsets)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  180.         Macro
  181.         _HiliteText
  182.             move.l              #$800E001C,-(sp)
  183.             dc.w                $A8B5
  184.         EndM
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION HiliteText
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal void DrawJust(Ptr textPtr, short textLength, short slop)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  193.         Macro
  194.         _DrawJust
  195.             move.l              #$8008001E,-(sp)
  196.             dc.w                $A8B5
  197.         EndM
  198.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  199.         IMPORT_CFM_FUNCTION DrawJust
  200.     ENDIF
  201.  
  202. ;
  203. ; pascal void MeasureJust(Ptr textPtr, short textLength, short slop, Ptr charLocs)
  204. ;
  205.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  206.         Macro
  207.         _MeasureJust
  208.             move.l              #$800C0020,-(sp)
  209.             dc.w                $A8B5
  210.         EndM
  211.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  212.         IMPORT_CFM_FUNCTION MeasureJust
  213.     ENDIF
  214.  
  215. ;
  216. ; pascal Fixed PortionText(Ptr textPtr, long textLength)
  217. ;
  218.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  219.         Macro
  220.         _PortionText
  221.             move.l              #$84080024,-(sp)
  222.             dc.w                $A8B5
  223.         EndM
  224.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  225.         IMPORT_CFM_FUNCTION PortionText
  226.     ENDIF
  227.  
  228. ;
  229. ; pascal long VisibleLength(Ptr textPtr, long textLength)
  230. ;
  231.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  232.         Macro
  233.         _VisibleLength
  234.             move.l              #$84080028,-(sp)
  235.             dc.w                $A8B5
  236.         EndM
  237.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  238.         IMPORT_CFM_FUNCTION VisibleLength
  239.     ENDIF
  240.  
  241. ;
  242. ; pascal void GetFormatOrder(FormatOrderPtr ordering, short firstFormat, short lastFormat, Boolean lineRight, StyleRunDirectionUPP rlDirProc, Ptr dirParam)
  243. ;
  244.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  245.         Macro
  246.         _GetFormatOrder
  247.             move.l              #$8012FFFC,-(sp)
  248.             dc.w                $A8B5
  249.         EndM
  250.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION GetFormatOrder
  252.     ENDIF
  253.  
  254.  
  255.  
  256. ;
  257. ; pascal void TextFont(short font)
  258. ;
  259.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  260.         _TextFont:    OPWORD    $A887
  261.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  262.         IMPORT_CFM_FUNCTION TextFont
  263.     ENDIF
  264.  
  265. ;
  266. ; pascal void TextFace(StyleParameter face)
  267. ;
  268.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  269.         _TextFace:    OPWORD    $A888
  270.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  271.         IMPORT_CFM_FUNCTION TextFace
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal void TextMode(short mode)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  278.         _TextMode:    OPWORD    $A889
  279.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  280.         IMPORT_CFM_FUNCTION TextMode
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal void TextSize(short size)
  285. ;
  286.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  287.         _TextSize:    OPWORD    $A88A
  288.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  289.         IMPORT_CFM_FUNCTION TextSize
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal void SpaceExtra(Fixed extra)
  294. ;
  295.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  296.         _SpaceExtra:    OPWORD    $A88E
  297.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION SpaceExtra
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal void DrawChar(CharParameter ch)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  305.         _DrawChar:    OPWORD    $A883
  306.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  307.         IMPORT_CFM_FUNCTION DrawChar
  308.     ENDIF
  309.  
  310. ;
  311. ; pascal void DrawString(ConstStr255Param s)
  312. ;
  313.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  314.         _DrawString:    OPWORD    $A884
  315.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  316.         IMPORT_CFM_FUNCTION DrawString
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal void DrawText(const void *textBuf, short firstByte, short byteCount)
  321. ;
  322.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  323.         _DrawText:    OPWORD    $A885
  324.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  325.         IMPORT_CFM_FUNCTION DrawText
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal short CharWidth(CharParameter ch)
  330. ;
  331.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  332.         _CharWidth:    OPWORD    $A88D
  333.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  334.         IMPORT_CFM_FUNCTION CharWidth
  335.     ENDIF
  336.  
  337. ;
  338. ; pascal short StringWidth(ConstStr255Param s)
  339. ;
  340.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  341.         _StringWidth:    OPWORD    $A88C
  342.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  343.         IMPORT_CFM_FUNCTION StringWidth
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal short TextWidth(const void *textBuf, short firstByte, short byteCount)
  348. ;
  349.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  350.         _TextWidth:    OPWORD    $A886
  351.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  352.         IMPORT_CFM_FUNCTION TextWidth
  353.     ENDIF
  354.  
  355. ;
  356. ; pascal void MeasureText(short count, const void *textAddr, void *charLocs)
  357. ;
  358.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  359.         _MeasureText:    OPWORD    $A837
  360.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  361.         IMPORT_CFM_FUNCTION MeasureText
  362.     ENDIF
  363.  
  364. ;
  365. ; pascal void GetFontInfo(FontInfo *info)
  366. ;
  367.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  368.         _GetFontInfo:    OPWORD    $A88B
  369.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  370.         IMPORT_CFM_FUNCTION GetFontInfo
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal void CharExtra(Fixed extra)
  375. ;
  376.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  377.         _CharExtra:    OPWORD    $AA23
  378.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  379.         IMPORT_CFM_FUNCTION CharExtra
  380.     ENDIF
  381.  
  382. ;
  383. ; pascal void StdText(short count, const void *textAddr, Point numer, Point denom)
  384. ;
  385.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  386.         _StdText:    OPWORD    $A882
  387.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  388.         IMPORT_CFM_FUNCTION StdText
  389.     ENDIF
  390.  
  391. ;
  392. ; pascal short StdTxMeas(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info)
  393. ;
  394.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  395.         _StdTxMeas:    OPWORD    $A8ED
  396.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  397.         IMPORT_CFM_FUNCTION StdTxMeas
  398.     ENDIF
  399.  
  400.  
  401.     IF OLDROUTINENAMES THEN
  402.     ENDIF    ; OLDROUTINENAMES
  403.     ENDIF ; __QUICKDRAWTEXT__ 
  404.  
  405.